#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	double a = 0;
	int b = 0;
	scanf("%lf", &a);
	b = (int)a;
	printf("%d", b % 10);
	return 0;
}